package com.tenbent.product.center.resource.bo;

import com.tenbent.product.base.bo.BizObject;
import com.tenbent.product.base.mybatis.annotations.TypeAlias;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 *
 * 资源实体类
 *
 * @author Randy
 *
 *         Created by ThinkPad on 2017/9/12.
 */
@Entity
@Table(name = "pc_resource")
@TypeAlias("resource")
public class Resource extends BizObject {

	/** 资源名称 */
	@Column
	private String name;

	/** 资源url */
	@Column
	private String url;

	/** 描述 */
	@Column
	private String description;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		Resource resource = (Resource) o;

		if (name != null ? !name.equals(resource.name) : resource.name != null)
			return false;
		if (url != null ? !url.equals(resource.url) : resource.url != null)
			return false;
		return description != null ? description.equals(resource.description) : resource.description == null;

	}

	@Override
	public int hashCode() {
		int result = name != null ? name.hashCode() : 0;
		result = 31 * result + (url != null ? url.hashCode() : 0);
		result = 31 * result + (description != null ? description.hashCode() : 0);
		return result;
	}

	@Override
	public String toString() {
		return "Resource{" + "name='" + name + '\'' + ", url='" + url + '\'' + ", description='" + description + '\''
				+ '}';
	}
}
